import java.util.Scanner;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/4/29
 * Time:15:09
 **/
public class Main2 {
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            String num = Integer.toBinaryString(n);
            System.out.println(findNumOf1(num));
        }
    }

    /**
     * 每日一题-查找输入整数二进制1的个数
     *
     * @param n
     * @return
     */
    private static int findNumOf1(String n) {
        int count = 0;
        for (char item : n.toCharArray()
        ) {
            if (item == '1') {
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int count = 0;
            while (n != 0) {
                if ((n & 1) == 1) {//判断当前位为1
                    count++;
                }
                n >>= 1;//右移一位
            }
            System.out.println(count);
        }
    }
}
